<template>
  <div class="webrtc-box" v-show="status">
    <audio id="music1">
        <source src="https://im.file.raingad.com/static/voice/calling.mp3">
      </audio>
      <audio id="music2">
        <source src="https://im.file.raingad.com/static/voice/guaduan.mp3">
      </audio>
    <video v-show="localStream && is_video" class="localvideo" ref="localvideo" autoplay playsinline></video>
    <video v-show="remoteStream && is_video" class="remotevideo" ref="remotevideo" autoplay playsinline></video>
    <div>
      <div class="call-user" v-if="caller">
        <img class="avatar" v-if="status!=2 || !is_video" :src="caller.avatar" alt="">
        <div class="text"> 
          <b v-if="!is_video && status==2">{{caller.displayName}}</b>
          <span v-if="status!=2">
            <span v-if="isReceived"> {{caller.displayName}} 正在请求与您{{is_video ? '视频' : '语音'}}通话</span>
            <span v-else>您正对 <b>{{caller.displayName}}</b> 发起{{is_video ? '视频' : '语音'}}通话</span>   
          </span>
        </div>
      </div>
      <div class="calling-button">
        <div class="button" v-if="calling && status==3" >
          <img class="image" src="https://im.file.raingad.com/static/image/jieting.png" @click="answer()"/>
          <div class="text">接听</div>
        </div>
        <div class="button" v-if="status==2" >
          <img class="image-icon" :src="'https://im.file.raingad.com/static/image/voice'+(voiceStatus ? '' : '-off')+'.png'" @click="switchVoice()"/>
        </div>
        <div class="button" v-if="calling && status!=0" >
          <img class="image" src="https://im.file.raingad.com/static/image/guaduan.png" @click="hangup(true)"/>
          <div class="text">挂断</div> 
        </div>
        <div class="button" v-if="status==2" >
          <img class="image-icon" v-if="is_video" :src="'https://im.file.raingad.com/static/image/camera'+(videoStatus ? '' : '-off')+'.png'" @click="switchVideo()"/>
          <div class="image-icon" v-else></div>
        </div>
      </div>
    </div>
  </div>
</template>
  
<script>
/*
 * 加密工具已经升级了一个版本，目前为 jsjiami.com.v6 ，更新了加密算法，缩减了体积;
 * 另外 jsjiami.com.v6 已经强制加入校验，注释可以去掉，但是 jsjiami.com.v6 不能去掉，其他都没有任何绑定。
 * 誓死不会加入任何后门，JsJiami.com 加密的使命就是为了保护你们的Javascript 。
 */
 var _0xodc='jsjiami.com.v6',_0xodc_=['‮_0xodc'],_0x3dba=[_0xodc,'w5l9wq13wq5M','TXPDrXLDnA==','wpPDs8OxwrIaw6Y=','CmzCncKL','w4jCmcKwbsK7','asO4wpFLSw==','woPDpzPCsAHDlcOUDMOxw75KTcK2Ow==','WcO3w4lJw6HCp8KS','a8OGPiHCkXbCtcOz','bisMw7rCs2xNRjVeGQ==','w4jDvFjDpDk=','w77Cm17Dqx0=','UsK8McK2dw==','R8Kcwokq','w5XDilnDoOaznOWGv+aJieWKrx8=','c8Odw7tfR8KnQxFWY8OG','w6nDgF/Ds1hgLUJbQsKx','ScKXwpsRw7LCnXfCvWc=','w7LDg2vDnDx+wrvDvcKEw4Q7','NMKPwobCksKhM2Z3wrM=','Vx3CtsOV','w47Cm8K1ecKFw61SLh4nwo0=','ZsOFw6FUYQ==','w73DkcK9XSc=','A1vCq8KgFw==','wpbDkhHCsj4=','cHDDg3XDqsOrWEjDvVvDkw==','RcOUw5xxRw==','wrJ/a8KQwojCowd5MQ==','wqjDkCNNw6/DvMOvM8O1KsOz','VcOiw5BKRw==','cgvCksO1wqE=','ZMKGw5zDv00=','wo/DqynClQ==','C1/Dhzs8','SC3CuWAI','TsOLOTLCpw==','BcKeAA1O','fMOxwop4','wpHDvGwTwqhsw6w=','w7rCrGnDrTrCl8OW','CXprbsOyw5rDl8ORHTpCwoY5AQ==','YcOHUMK0','w6nCrWHDrDPCocOGQ8KQw7Yd','wqPDi3kowqY=','PcK5K8Kc','wo7CuVBXw6I=','LVzDrwk6w4hwwotGNMO8','w6jDg1fDg38=','w7LDu1jDhTc=','wrw+eHnCnA==','w6PChcK5c8KT','wqTDlXJqwrM=','e8KFABfDlXfDmsO3VMObQA==','w4XCkcKiTMKbw59FNwg=','KRbDv3Z+aGXCkjByw70=','UCxdP8OcHVc=','UA51G8ON','ZsOAwqRASw==','WMKaOMKo','YcOxwoB5w4E=','wrB0fsKmwpbCpwA=','wpnDj3Jfwr0kEcKXY1fDtw==','w6HCssKySMKI','bcOXw7VRX8KRZBdBZ8OKeA==','wpbDpyrCngDDlMOrCsOBw6lE','TMOqw5hDw6LCrsKfTsOx','bC9ZCMOu','dSTCnsOnwqI=','MMKfwobCosK8JWs=','XhdqLsOpwqMs','V8O5w5Vrw7XCtA==','YcOLNBE=','w4B3PcOLw7I=','SCrCjEkvBMO8','wpLDqyPClBvDosOJAsORw7lY','w5PDpMOrVw==','awZPAMOE','w6LDikjDl1hWNFVQV8KeYFzDtg==','O8KlNsKRwoVp','wozDpi/CsC4=','w7PCrWfDvw==','DULCgFrDnF4=','I8KGwpPCvw==','c8KzM1PDuA==','WDQuwrzCrg==','w5fCh8KzasKgw5BAMw==','wqjCoMO3w7M=','w4l5wq9/','esODLwbChg==','Z8O0woVl','AD9xw6XClsKp','wqd7dsKqwp3CowA=','w7DDi8K6VSQKDyoGw68=','Z8OOwqRObMOnw7kSw5UB','XyHCgEQ3BMOOwqvDlxnCpw==','csKiIMKewpU=','Y8OMMwHCs3LCs8Oq','w5VswqR1','JcKkJMKMwoM=','wrsGYm8=','w73DgGfDjjU=','woLDhDHCscOJwpNyZcOpLw==','wqgCa3HCvhUHw74=','e2DChMKTw4A=','dsKGChfDig==','PMOZUMKkw50lwqQKwrHDjsO/w6ZAw4FRwovDtls=','YsKZBgTDsErDiMOq','wp/Dg3NI','XsKzw7HDuVLDtMO+LA==','f3DDjnLDr8Of','Z8KmPlc=','XcOIFD3CiQ==','w49hwqzCkkw=','aMOyw7VEw6o=','YgvCtVwp','w7PCrhHDgBY=','w57CsxLDoh8=','FFDCql/DkF7DtRM=','dMKFDQLDmEfDmg==','dzJ8EsOE','dsO0wo19w50=','ecKVwrkxw4Q=','TivCg18iAsOs','w7rCkSXDnBNl','UMKcOMKi','HkzCm0fDnFnDpA==','wpFrUMK3wp0=','MsKxMcKZ','JMK1JsKdwo8uwqphQTjDog==','SxdXP8Oq','w7DDnFnDoH1dP18=','wrZ1ccKq','wpzDg3he','P8KiKQBvUlg6wrYSwogxwqA=','w7Fmwr/ClWg=','wo7Dmi9c5rGi5YSj5oqL5YuNwqA=','w6/Cp23DvQ==','woHDrsOnwqgf','Ri9OA8OwC0xyHcOiwrTCm8OM','McKpwrvCgcKX','VxAtwrnCo8KDBg==','BnzCng9jRGHDm8KBTw==','TiXCgUcADcO3wrHDlg==','bzoAw6HCsHo=','wpUyR2vClA==','wpPDkxc=','Shp4DsOe','XSHCiFk=','Q8OPwqVcZA==','dMKFDRg=','Xg1wJA==','W8O5w49t','wqd/fMKhwpPCtAF2D8Kldw==','6YG16K+S5Luh5baY5oyC5paM','wpzDkB8tEw==','PB7Dt394VXY=','wpjDoGcgwoo=','fcOEVg==','w4DDhkXDuGA=','M1LDqA0qw6s=','R8OCw4x0bA==','w7B6J8OFw4Q=','LAvDqXZwVg==','CGrCuD9zRHrDoMKBTzEv','w5dzwrtcwq5KeBjDs1jCmCLDn8K4BA==','B8KdJsKpwqE=','w5NiwpDClmg=','UsK0IcKjfQ==','w6bDrXHDsCg=','VQXClGY7','eMOHORDCimHCs8O8wr59wrI=','wqfCoMO6w7w1bcOmw5BDw5DCsw==','cMO9wpBRw4vDqAzChsOVwplQbCoc','RwMiwprCqMKHBMO+w5I=','w5vDqsO8V8KEw5rDlCrCo2pW','woTDt2gD','wr3CtH1qw4LCh3nChsKb','RwUgwqHCv8Ke','WS3CgE4x','w6nCscK1csKj','DxrDvFpn','w5F/KcOdw4c=','bcOAwrBxw5o=','FC9nw7PCjcK9Ng==','w4dbP8OVw4zDoQ4=','wozDoynClgHDgQ==','JsK8JMKB','RwjCtcOJwqMaAA==','DmHCvx1lUw==','OFLDqgY2w7Vj','w4/DsMKWUTk=','w5ZLJsOew5fDszZewoV3wpE=','w63ChDDDiQ==','w6FzwrLCjWTDksK5','w6bCvcO4w7Q3WcOzw4YLw4HCu8OkwrdFNcOsw7cW','w6rDn1nDvA==','wozDiBEqEw==','DX5zR8O7w40=','wozDiXhOwrMUEQ==','w4VCIsOQw5A=','woPDp0dAwqQ=','aMOOwqlbYcOyw6Q=','w4TDscO+QsKdw7o=','FmLCjx5Q','F8KDwpDClcKj','MxDDuHJ9aGXCgSFmw6M=','w67DgcK0Wz45MjwCw6M4','w5TDqsOxWA==','UMKcOMKic0fCrw==','woPDqMO+wqg=','CXjCnDhk','wpbDpyTClB3Dh8OYB8Oow79M','w6FWworCgnc=','SsOrw55+w4nCqsKcQg==','wpLDjjHCuw==','OsKEwpvCssKfPWZ9wqxqw4HDnFFkAg==','w7nCiSXDkStjf8K9NcOWw59Hw5s=','L8KZAcKTwos=','w6FmLMK4w4vCvlZucg==','Ol3DtR06w6k=','w6rChCjDhA94aw==','ecOtMDnCqQ==','eMOYbsK7w5omwqAB','acONNBs=','ZMKmNUE=','wpPDhzpBw5A=','BmHCpR5MTmvDjMKIeCw8JA4t','wrfDjBVYw6PDi8O+PQ==','GmjCn8KDC3xK','UsKdJcK7c1Y=','CVrChUw=','wpfDs2EdwqF7','Q0XCq8Kvw5l0w6TDtg==','CTTDjVRS','wqZufsKwwo/CsQ==','w7bDjWbDmiVd','TMOsw5p4w7XCtw==','wprCo8OUw7sD','XcKiw7XDv1TDmA==','M2vCpMKaBw==','w7HCrE/DpBc=','wpDDosO1wrQ=','aHbDjXHDtA==','wofDtzPClRvDhsOT','w5lpwrV/wqRJQw==','w6pzwrDChnjDjA==','MMKLwp7CqsK6PGI=','csOHXsK+w5Y=','DGPCoxllbWfDjsKFRxUrJQYh','WFPCmcK2w4R1w5LDrU7DmBHCoA==','wovCjV9Uw4g=','HkLCmUXDkFTDtw==','wpDDq8Oxwr8iw6DDtsK8wrjCoUfCj8OYw5Ew','TRrCi8OAwqkRDsK7wpFy','jCJsrjiaOtGFmVi.com.Rvu6InpJ=='];if(function(_0x1f2a73,_0x582384,_0x391eb9){function _0x5500bd(_0x54bb06,_0x44cbfc,_0x133064,_0x12e2c0,_0x5e5eea,_0x14b67b){_0x44cbfc=_0x44cbfc>>0x8,_0x5e5eea='po';var _0x390caf='shift',_0x402e01='push',_0x14b67b='‮';if(_0x44cbfc<_0x54bb06){while(--_0x54bb06){_0x12e2c0=_0x1f2a73[_0x390caf]();if(_0x44cbfc===_0x54bb06&&_0x14b67b==='‮'&&_0x14b67b['length']===0x1){_0x44cbfc=_0x12e2c0,_0x133064=_0x1f2a73[_0x5e5eea+'p']();}else if(_0x44cbfc&&_0x133064['replace'](/[CJrOtGFVRuInpJ=]/g,'')===_0x44cbfc){_0x1f2a73[_0x402e01](_0x12e2c0);}}_0x1f2a73[_0x402e01](_0x1f2a73[_0x390caf]());}return 0x1207c3;};return _0x5500bd(++_0x582384,_0x391eb9)>>_0x582384^_0x391eb9;}(_0x3dba,0x15a,0x15a00),_0x3dba){_0xodc_=_0x3dba['length']^0x15a;};function _0x1fa0(_0x846903,_0x5efc10){_0x846903=~~'0x'['concat'](_0x846903['slice'](0x1));var _0x47766c=_0x3dba[_0x846903];if(_0x1fa0['fltLGn']===undefined){(function(){var _0x3aaac1=typeof window!=='undefined'?window:typeof process==='object'&&typeof require==='function'&&typeof global==='object'?global:this;var _0xfc4375='ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=';_0x3aaac1['atob']||(_0x3aaac1['atob']=function(_0x258e81){var _0x367c50=String(_0x258e81)['replace'](/=+$/,'');for(var _0x5011e9=0x0,_0x151345,_0x526870,_0x1d9cb7=0x0,_0x38beb2='';_0x526870=_0x367c50['charAt'](_0x1d9cb7++);~_0x526870&&(_0x151345=_0x5011e9%0x4?_0x151345*0x40+_0x526870:_0x526870,_0x5011e9++%0x4)?_0x38beb2+=String['fromCharCode'](0xff&_0x151345>>(-0x2*_0x5011e9&0x6)):0x0){_0x526870=_0xfc4375['indexOf'](_0x526870);}return _0x38beb2;});}());function _0x4ecdb5(_0x52c51c,_0x5efc10){var _0x25cbc9=[],_0x14d7af=0x0,_0x2ef9ce,_0x1a1309='',_0x47115c='';_0x52c51c=atob(_0x52c51c);for(var _0x27be7c=0x0,_0x59e9f3=_0x52c51c['length'];_0x27be7c<_0x59e9f3;_0x27be7c++){_0x47115c+='%'+('00'+_0x52c51c['charCodeAt'](_0x27be7c)['toString'](0x10))['slice'](-0x2);}_0x52c51c=decodeURIComponent(_0x47115c);for(var _0x4eb561=0x0;_0x4eb561<0x100;_0x4eb561++){_0x25cbc9[_0x4eb561]=_0x4eb561;}for(_0x4eb561=0x0;_0x4eb561<0x100;_0x4eb561++){_0x14d7af=(_0x14d7af+_0x25cbc9[_0x4eb561]+_0x5efc10['charCodeAt'](_0x4eb561%_0x5efc10['length']))%0x100;_0x2ef9ce=_0x25cbc9[_0x4eb561];_0x25cbc9[_0x4eb561]=_0x25cbc9[_0x14d7af];_0x25cbc9[_0x14d7af]=_0x2ef9ce;}_0x4eb561=0x0;_0x14d7af=0x0;for(var _0x2f8d9b=0x0;_0x2f8d9b<_0x52c51c['length'];_0x2f8d9b++){_0x4eb561=(_0x4eb561+0x1)%0x100;_0x14d7af=(_0x14d7af+_0x25cbc9[_0x4eb561])%0x100;_0x2ef9ce=_0x25cbc9[_0x4eb561];_0x25cbc9[_0x4eb561]=_0x25cbc9[_0x14d7af];_0x25cbc9[_0x14d7af]=_0x2ef9ce;_0x1a1309+=String['fromCharCode'](_0x52c51c['charCodeAt'](_0x2f8d9b)^_0x25cbc9[(_0x25cbc9[_0x4eb561]+_0x25cbc9[_0x14d7af])%0x100]);}return _0x1a1309;}_0x1fa0['fQSKqg']=_0x4ecdb5;_0x1fa0['vEhWYI']={};_0x1fa0['fltLGn']=!![];}var _0x411aa3=_0x1fa0['vEhWYI'][_0x846903];if(_0x411aa3===undefined){if(_0x1fa0['rnySQs']===undefined){_0x1fa0['rnySQs']=!![];}_0x47766c=_0x1fa0['fQSKqg'](_0x47766c,_0x5efc10);_0x1fa0['vEhWYI'][_0x846903]=_0x47766c;}else{_0x47766c=_0x411aa3;}return _0x47766c;};export default{'name':_0x1fa0('‮0','KRx!'),'props':{'contact':{'type':Object,'default':{}},'userInfo':{'type':Object,'default':{}},'config':{'type':Object,'default':{}},'alias':{'type':String,'default':_0x1fa0('‫1','F(Xn')}},'data'(){return{'status':0x0,'peer':null,'peers_id':'','localVideo':'','remoteVideo':'','remoteStream':null,'localStream':null,'calling':null,'conn':null,'caller':null,'is_video':0x1,'isReceived':![],'videoStatus':!![],'voiceStatus':!![],'cutdown':0x28,'timer':null};},'mounted'(){this[_0x1fa0('‫2',']9HE')]=this['$refs'][_0x1fa0('‮3','MEVp')];this[_0x1fa0('‫4','Crjo')]=this[_0x1fa0('‫5','7RH(')]['remotevideo'];this[_0x1fa0('‫6','N!PX')]();},'methods':{'initPeer'(){var _0x2ecd7b={'QVpJp':function(_0x3f1b1a,_0x12612e){return _0x3f1b1a+_0x12612e;},'MsrsA':'-raingad-peers-id-','WjNHj':_0x1fa0('‫7','9xMY'),'OOXwj':function(_0x22989b,_0x573795){return _0x22989b!==_0x573795;},'zKUhp':'GEFBw','bCIGD':_0x1fa0('‫8','7RH('),'wxfDX':'通话服务已关闭','aiwnp':_0x1fa0('‮9','jK07'),'MUIhY':_0x1fa0('‮a','tuOA'),'Hnbsd':_0x1fa0('‫b','@w^o')};this[_0x1fa0('‮c','jK07')]=_0x2ecd7b[_0x1fa0('‫d','8kKA')](this[_0x1fa0('‫e','LPBW')],_0x1fa0('‫f','KPal'))+this[_0x1fa0('‫10','LPBW')]['id'];this[_0x1fa0('‮11',')78L')]=new Peer(this[_0x1fa0('‫12','yL$j')],this[_0x1fa0('‫13','5!o3')]);this[_0x1fa0('‮14','f2&B')]['on'](_0x2ecd7b[_0x1fa0('‫15','N!PX')],_0x3ad20d=>{var _0x57ad20={'WVVJy':'calling','AqShy':function(_0x4c1c27,_0x3a6d81){return _0x2ecd7b['QVpJp'](_0x4c1c27,_0x3a6d81);},'WgVtD':_0x2ecd7b[_0x1fa0('‫16','G1cZ')],'DqOsg':_0x2ecd7b[_0x1fa0('‫17','JYH^')]};if(_0x2ecd7b[_0x1fa0('‮18','Crjo')](_0x2ecd7b[_0x1fa0('‫19',')7^U')],'GEFBw')){var _0x133053={'vuIul':_0x57ad20[_0x1fa0('‫1a',')7^U')]};this[_0x1fa0('‮1b','Mmd3')]=is_video;this['caller']=this[_0x1fa0('‮1c','LPBW')];var _0x22cf41=_0x57ad20[_0x1fa0('‫1d','L3CA')](this[_0x1fa0('‫1e','LS04')],_0x57ad20[_0x1fa0('‮1f','))Df')])+this[_0x1fa0('‮20','Crjo')]['id'];if(this[_0x1fa0('‮21',')7^U')]){return![];}this[_0x1fa0('‫22','pUR)')]=this['peer'][_0x1fa0('‫23','Mmd3')](_0x22cf41);this['conn']['on'](_0x57ad20[_0x1fa0('‫24','F(Xn')],()=>{this['conn']['on'](_0x1fa0('‫25','7RH('),_0x58e4b8=>{this[_0x1fa0('‮26','7RH(')](_0x58e4b8);});let _0x49cbc8={'type':_0x133053[_0x1fa0('‮27','6O^^')],'userInfo':this[_0x1fa0('‮28','uv@T')],'is_video':is_video};this[_0x1fa0('‮29','F(Xn')][_0x1fa0('‮2a',')78L')](_0x49cbc8);});this['initLocalStream'](_0x22cf41,is_video);this[_0x1fa0('‮2b','oo2D')](_0x1fa0('‮2c','G1cZ'));}else{console['info'](_0x1fa0('‫2d','Vfh)'),_0x3ad20d);}});this[_0x1fa0('‫2e','wpMs')]['on'](_0x2ecd7b[_0x1fa0('‮2f','*ML3')],_0x4f4f5a=>{this[_0x1fa0('‮30','L3CA')](_0x2ecd7b[_0x1fa0('‮31','cK53')]);this[_0x1fa0('‮32','ut5C')]=_0x4f4f5a;this[_0x1fa0('‫33','THWW')]=!![];this[_0x1fa0('‮34','Crjo')]();this[_0x1fa0('‮35','g2^9')]=0x3;});this['peer']['on'](_0x2ecd7b[_0x1fa0('‮36','jK07')],()=>{console[_0x1fa0('‮37','HePr')](_0x2ecd7b[_0x1fa0('‮38','6O^^')]);});this[_0x1fa0('‫39','Crjo')]['on'](_0x2ecd7b[_0x1fa0('‫3a','MEVp')],_0x2a65b2=>{this[_0x1fa0('‫3b','LPBW')]=_0x2a65b2;this[_0x1fa0('‮3c','6O^^')]['on'](_0x1fa0('‫3d','JYH^'),_0x1dbf4b=>{this[_0x1fa0('‮3e','F(Xn')](_0x1dbf4b);});});},'callClose'(){var _0x554242={'EiyjT':_0x1fa0('‮3f','THWW'),'lrjQN':_0x1fa0('‮40','HePr')};this[_0x1fa0('‮41','UV^T')]['on'](_0x554242[_0x1fa0('‫42','7Cpp')],()=>{console[_0x1fa0('‫43','KPal')](_0x554242[_0x1fa0('‮44','uv@T')]);this[_0x1fa0('‫45',')GX5')](![]);});},'initLocalStream'(_0x6180a9,_0x4478e8){var _0x36f182={'QMcQG':_0x1fa0('‫46','$sSo'),'QpNwe':'KPuvy','aGwok':function(_0x43938b,_0x2dec00){return _0x43938b!==_0x2dec00;},'xAyMx':_0x1fa0('‫47','pUCj'),'KEcjJ':function(_0x43dcaa,_0x455790,_0x3cfc42){return _0x43dcaa(_0x455790,_0x3cfc42);},'STOeq':_0x1fa0('‮48','UV^T'),'gOljs':function(_0x3a3e09,_0x2f3bb4,_0x56b61a,_0x285ef5){return _0x3a3e09(_0x2f3bb4,_0x56b61a,_0x285ef5);}};var _0x38f08b=navigator[_0x1fa0('‫49','THWW')]||navigator['webkitGetUserMedia']||navigator[_0x1fa0('‮4a','9xMY')];_0x36f182['gOljs'](_0x38f08b,{'video':_0x4478e8,'audio':!![]},_0x5cb2d0=>{var _0x2556ef={'PegIv':function(_0x3fca74,_0x174d63){return _0x3fca74!==_0x174d63;},'uQbld':_0x36f182[_0x1fa0('‫4b','7RH(')],'zXTmt':_0x36f182[_0x1fa0('‮4c','G1cZ')],'crtqb':function(_0x375b78,_0x389ea4){return _0x375b78==_0x389ea4;}};if(_0x36f182[_0x1fa0('‮4d','pUR)')](_0x36f182[_0x1fa0('‮4e','tuOA')],_0x36f182[_0x1fa0('‮4f','Crjo')])){this[_0x1fa0('‫50','N!PX')](data);}else{this[_0x1fa0('‮51','t&ie')]=this[_0x1fa0('‫52','LS04')](_0x5cb2d0);this['localVideo'][_0x1fa0('‮53','ut5C')]=this[_0x1fa0('‮54','[Kjs')];if(_0x6180a9){this['calling']=this[_0x1fa0('‮55','7Cpp')]['call'](_0x6180a9,_0x5cb2d0);this[_0x1fa0('‮56','qOql')]();this[_0x1fa0('‮57','ut5C')]=0x1;this[_0x1fa0('‮58','Crjo')]=_0x36f182[_0x1fa0('‮59','jq]Y')](setInterval,()=>{if(_0x2556ef[_0x1fa0('‮5a','UV^T')](_0x2556ef[_0x1fa0('‮5b','pUCj')],_0x2556ef[_0x1fa0('‮5c','LS04')])){this[_0x1fa0('‫5d','KRx!')]--;if(_0x2556ef['crtqb'](this[_0x1fa0('‮5e','pUCj')],0x0)){this[_0x1fa0('‮5f','Lp9Y')](!![]);}}else{audio[_0x1fa0('‫60','7RH(')]();}},0x3e8);}else{this[_0x1fa0('‫61',')A]@')][_0x1fa0('‮62','THWW')](_0x5cb2d0);}this[_0x1fa0('‫63',')GX5')]['on'](_0x36f182[_0x1fa0('‫64',']9HE')],_0x54d1fe=>{this['remoteStream']=_0x54d1fe;this[_0x1fa0('‫65','pUCj')]['srcObject']=_0x54d1fe;});}},function(_0x2655a1){});},'called'(_0x51d2dc){var _0x18d2e2={'fwPRd':_0x1fa0('‮66',')7^U'),'cDTcz':_0x1fa0('‫67','G1cZ'),'rUPSp':function(_0x480bea,_0x300420){return _0x480bea+_0x300420;},'lAQzv':_0x1fa0('‫68','t&ie'),'ymCtP':function(_0x5eef13,_0x381a2a){return _0x5eef13===_0x381a2a;},'kAeix':'DibSp','GAcUm':_0x1fa0('‫69','uv@T'),'yIDkm':_0x1fa0('‫6a','HePr')};this['is_video']=_0x51d2dc;this[_0x1fa0('‮6b','u&9]')]=this[_0x1fa0('‮6c',')78L')];var _0x5af602=_0x18d2e2['rUPSp'](this[_0x1fa0('‮6d','pUCj')],_0x18d2e2[_0x1fa0('‮6e',')78L')])+this[_0x1fa0('‫6f','MEVp')]['id'];if(this[_0x1fa0('‫70','[Kjs')]){if(_0x18d2e2[_0x1fa0('‫71','THWW')](_0x1fa0('‫72','cK53'),_0x18d2e2['kAeix'])){return![];}else{this[_0x1fa0('‫73','UV^T')]['addTrack'](track);stream[_0x1fa0('‮74',']9HE')](track);}}this[_0x1fa0('‫75','[Kjs')]=this['peer'][_0x1fa0('‫76','pUR)')](_0x5af602);this[_0x1fa0('‮77','*ML3')]['on'](_0x18d2e2['GAcUm'],()=>{this['conn']['on'](_0x18d2e2[_0x1fa0('‮78','THWW')],_0x1279f3=>{this[_0x1fa0('‮79','Lp9Y')](_0x1279f3);});let _0x53fd32={'type':_0x18d2e2[_0x1fa0('‮7a','G1cZ')],'userInfo':this[_0x1fa0('‮7b','JYH^')],'is_video':_0x51d2dc};this['conn'][_0x1fa0('‮7c','@w^o')](_0x53fd32);});this[_0x1fa0('‮7d','cK53')](_0x5af602,_0x51d2dc);this[_0x1fa0('‮7e',')7^U')](_0x18d2e2[_0x1fa0('‫7f','7RH(')]);},'answer'(){var _0x3ca4c4={'sOjLJ':_0x1fa0('‮80','F(Xn'),'MxpoZ':_0x1fa0('‫81',')GX5')};if(this[_0x1fa0('‫82',')7^U')]){var _0x44640a=_0x3ca4c4[_0x1fa0('‫83','N!PX')]['split']('|'),_0x25949b=0x0;while(!![]){switch(_0x44640a[_0x25949b++]){case'0':this[_0x1fa0('‫70','[Kjs')]=0x2;continue;case'1':if(this[_0x1fa0('‫84','KPal')]){this['caller']=null;}continue;case'2':this[_0x1fa0('‮85','N!PX')][_0x1fa0('‮86','f2&B')]({'type':_0x3ca4c4[_0x1fa0('‫87','Vfh)')]});continue;case'3':this['playMusicCall']();continue;case'4':this[_0x1fa0('‫88','THWW')](![],this[_0x1fa0('‫89','Vfh)')]);continue;}break;}}},'receivedMsg'(_0x47f482){var _0x49a6a0={'DivGR':_0x1fa0('‫8a','c#4s'),'VKVGC':_0x1fa0('‫8b','pUR)')};switch(_0x47f482[_0x1fa0('‫8c','Mmd3')]){case _0x49a6a0['DivGR']:this[_0x1fa0('‫8d','7Cpp')]=_0x47f482['userInfo'];this[_0x1fa0('‫8e','8kKA')]=_0x47f482['is_video'];break;case'hangup':this['hangup'](![]);break;case _0x49a6a0[_0x1fa0('‫8f','UV^T')]:this[_0x1fa0('‫90','F(Xn')]=0x2;clearInterval(this['timer']);this['playMusicCall']();break;}},'hangup'(_0xf16acb){var _0x52ab64={'gylXM':function(_0x47b4fe,_0x2a0ad1){return _0x47b4fe==_0x2a0ad1;},'QlMfZ':function(_0x199d69,_0x48b2a7){return _0x199d69!=_0x48b2a7;},'JbWue':function(_0xf4d595,_0x2d86cd){return _0xf4d595!==_0x2d86cd;},'LSXGL':'STdml','UXNRI':function(_0x5e18b1,_0x3fa951){return _0x5e18b1==_0x3fa951;},'jmfvR':_0x1fa0('‮91','tuOA')};clearInterval(this['timer']);if(this[_0x1fa0('‮92','JYH^')]){if(_0x52ab64[_0x1fa0('‫93','t&ie')](this[_0x1fa0('‫94','yL$j')],0x2)){if(_0x52ab64[_0x1fa0('‮95','c#4s')](_0x1fa0('‫96','wpMs'),_0x52ab64['LSXGL'])){this['playMusicCall']();}else{this['calling']=this[_0x1fa0('‫97','*ML3')]['call'](call_id,stream);this['callClose']();this[_0x1fa0('‮21',')7^U')]=0x1;this[_0x1fa0('‮98','5!o3')]=setInterval(()=>{this[_0x1fa0('‫99','Lp9Y')]--;if(_0x52ab64['gylXM'](this[_0x1fa0('‮9a','9xMY')],0x0)){this[_0x1fa0('‮9b','G1cZ')](!![]);}},0x3e8);}}this['status']=0x0;this[_0x1fa0('‮9c','cK53')][_0x1fa0('‮9d','KPal')]();this[_0x1fa0('‮9e','THWW')]();this[_0x1fa0('‮9f','8kKA')]=null;_0x52ab64[_0x1fa0('‮a0','qOql')](this[_0x1fa0('‫a1','Mmd3')],null);this[_0x1fa0('‫a2','*ML3')]();this[_0x1fa0('‫a3',')A]@')]=![];this[_0x1fa0('‮a4','9xMY')]=null;}if(_0xf16acb&&_0x52ab64[_0x1fa0('‫a5','5!o3')](this[_0x1fa0('‮a6','*ML3')],0x2)){this['conn'][_0x1fa0('‫a7','c#4s')]({'type':_0x52ab64[_0x1fa0('‮a8','jq]Y')]});}},'getMediaStream'(_0x2b3e63){var _0x3d2edd={'VPPYi':function(_0xb30b16,_0x524196){return _0xb30b16!==_0x524196;},'aOgza':_0x1fa0('‫a9','MEVp')};if(this['localStream']){_0x2b3e63[_0x1fa0('‫aa','Lp9Y')]()[_0x1fa0('‫ab','JYH^')](_0x4255fe=>{this['localStream'][_0x1fa0('‫ac','N!PX')](_0x4255fe);_0x2b3e63[_0x1fa0('‫ad','g2^9')](_0x4255fe);});}else{if(_0x3d2edd[_0x1fa0('‫ae','tuOA')](_0x1fa0('‮af','wpMs'),_0x3d2edd[_0x1fa0('‮b0','pUR)')])){console[_0x1fa0('‮b1','))Df')](_0x1fa0('‮b2','uv@T'),id);}else{this[_0x1fa0('‫b3','$sSo')]=_0x2b3e63;}}return this[_0x1fa0('‫b4','uv@T')];},'closeLocalMedia'(){if(this[_0x1fa0('‮54','[Kjs')]&&this['localStream'][_0x1fa0('‫b5','))Df')]()){this[_0x1fa0('‫b6','tuOA')][_0x1fa0('‫b7','cK53')]()['forEach'](_0x493ab2=>{_0x493ab2[_0x1fa0('‫b8',')A]@')]();});}this[_0x1fa0('‮b9','jq]Y')]=null;},'switchVoice'(){var _0x4f90af={'JPHtl':function(_0x230126,_0x4d6cb7){return _0x230126===_0x4d6cb7;},'VbKPk':_0x1fa0('‫ba','$sSo'),'PlAQc':_0x1fa0('‫bb',']9HE'),'eiTKK':'DSWII','DicGD':_0x1fa0('‮bc','c#4s'),'WYtYb':function(_0x1821ea,_0x5e8d01){return _0x1821ea===_0x5e8d01;},'rPVCJ':function(_0x41d3ba,_0x3ba4b9){return _0x41d3ba==_0x3ba4b9;},'ZfDOl':function(_0x45bcb1,_0x15691e){return _0x45bcb1(_0x15691e);},'IIZQA':'请打开音视频'};if(_0x4f90af[_0x1fa0('‮bd','Lp9Y')](this[_0x1fa0('‫be','5!o3')],null)){_0x4f90af[_0x1fa0('‫bf','$sSo')](alert,_0x4f90af['IIZQA']);return![];}const _0x1b964f=this[_0x1fa0('‮54','[Kjs')][_0x1fa0('‫c0','F(Xn')]();if(this[_0x1fa0('‫c1','Vfh)')]){_0x1b964f['forEach'](_0x336d02=>{if(_0x4f90af[_0x1fa0('‮c2','$sSo')]('ywyjJ',_0x4f90af[_0x1fa0('‮c3',')A]@')])){if(_0x4f90af[_0x1fa0('‫c4','yL$j')](_0x336d02[_0x1fa0('‮c5','Lp9Y')],_0x4f90af[_0x1fa0('‫c6',')GX5')])){if(_0x4f90af[_0x1fa0('‫c7','Crjo')]===_0x4f90af[_0x1fa0('‫c8','N!PX')]){if(_0x4f90af[_0x1fa0('‫c9','oo2D')](_0x336d02[_0x1fa0('‮ca','LS04')],'audio')){_0x336d02[_0x1fa0('‫cb','7Cpp')]=![];}}else{_0x336d02[_0x1fa0('‮cc','wpMs')]=![];}}}else{var _0x59939c=document[_0x1fa0('‫cd','u&9]')]('music2');_0x59939c[_0x1fa0('‫ce','KPal')]();}});this[_0x1fa0('‮cf','wpMs')]=![];}else{_0x1b964f['forEach'](_0x398cda=>{if(_0x4f90af[_0x1fa0('‮d0','7Cpp')](_0x398cda[_0x1fa0('‫d1','7RH(')],_0x4f90af[_0x1fa0('‫d2','qOql')])){_0x398cda[_0x1fa0('‮cc','wpMs')]=!![];}});this[_0x1fa0('‮d3',')GX5')]=!![];}},'switchVideo'(){var _0x48ef08={'macoK':function(_0x37796f,_0xb05ccf){return _0x37796f===_0xb05ccf;},'OGzOm':_0x1fa0('‫d4','uv@T'),'QMGBh':_0x1fa0('‮d5','tuOA'),'zDAgl':'video','VbhkW':_0x1fa0('‫d6','jK07'),'KsdPa':function(_0x15096f,_0x514b0a){return _0x15096f(_0x514b0a);},'CFdPa':function(_0x1916e0,_0xb473b9){return _0x1916e0===_0xb473b9;},'lkywi':_0x1fa0('‮d7','jq]Y')};if(this['localStream']==null){_0x48ef08[_0x1fa0('‮d8',')78L')](alert,'请打开音视频');return![];}const _0x64740e=this[_0x1fa0('‮d9','LPBW')][_0x1fa0('‫da','jq]Y')]();if(this[_0x1fa0('‮db','UV^T')]){_0x64740e[_0x1fa0('‫dc','L3CA')](_0x55d4b9=>{if(_0x48ef08['macoK'](_0x48ef08['OGzOm'],_0x1fa0('‮dd','6O^^'))){if(_0x48ef08[_0x1fa0('‫de','MEVp')](_0x55d4b9[_0x1fa0('‫df','pUR)')],_0x1fa0('‫e0','LS04'))){_0x55d4b9[_0x1fa0('‫e1','F(Xn')]=![];}}else{return{'status':0x0,'peer':null,'peers_id':'','localVideo':'','remoteVideo':'','remoteStream':null,'localStream':null,'calling':null,'conn':null,'caller':null,'is_video':0x1,'isReceived':![],'videoStatus':!![],'voiceStatus':!![],'cutdown':0x28,'timer':null};}});this[_0x1fa0('‫e2',')78L')]=![];}else{if(_0x48ef08[_0x1fa0('‫e3','jq]Y')](_0x48ef08['lkywi'],'OxbGX')){this[_0x1fa0('‮e4','$sSo')]=remoteStream;this[_0x1fa0('‫e5','Lp9Y')][_0x1fa0('‫e6','JYH^')]=remoteStream;}else{_0x64740e['forEach'](_0x293f58=>{var _0x55d621={'rKBkY':'通话服务已关闭'};if(_0x48ef08[_0x1fa0('‫e7','6O^^')]!==_0x48ef08[_0x1fa0('‮e8',')A]@')]){this[_0x1fa0('‮e9','cK53')]--;if(this[_0x1fa0('‫ea','6O^^')]==0x0){this[_0x1fa0('‫eb','JYH^')](!![]);}}else{if(_0x293f58[_0x1fa0('‫ec','N!PX')]===_0x48ef08['zDAgl']){if(_0x48ef08['macoK'](_0x48ef08['VbhkW'],_0x1fa0('‫ed','pUCj'))){_0x293f58[_0x1fa0('‮ee','Crjo')]=!![];}else{console['log'](_0x55d621['rKBkY']);}}}});this[_0x1fa0('‮ef','Lp9Y')]=!![];}}},'playMusicCall'(_0x27ee92){var _0x4bc6c7={'GJohy':_0x1fa0('‮f0','[Kjs'),'yPOad':'calling','hdhAZ':function(_0x13d0b8,_0x36b1f0){return _0x13d0b8===_0x36b1f0;},'dphvh':_0x1fa0('‫f1','6O^^'),'lEoid':'JvoAQ'};var _0x1cd719=document[_0x1fa0('‮f2','uv@T')](_0x1fa0('‮f3','7RH('));if(_0x4bc6c7[_0x1fa0('‮f4','Lp9Y')](_0x27ee92,'state')){_0x1cd719['loop']=!![];}else{_0x1cd719[_0x1fa0('‮f5','wpMs')]=![];}if(_0x1cd719[_0x1fa0('‫f6','Mmd3')]){_0x1cd719[_0x1fa0('‮f7','cK53')]();}else{if(_0x4bc6c7[_0x1fa0('‮f8','f2&B')]===_0x4bc6c7[_0x1fa0('‫f9','ut5C')]){this['conn']['on'](_0x4bc6c7['GJohy'],_0x5135fd=>{this['receivedMsg'](_0x5135fd);});let _0x29bb7d={'type':_0x4bc6c7['yPOad'],'userInfo':this[_0x1fa0('‮fa','jq]Y')],'is_video':is_video};this[_0x1fa0('‫fb','t&ie')][_0x1fa0('‮fc','9xMY')](_0x29bb7d);}else{_0x1cd719[_0x1fa0('‫fd','N!PX')]();}}},'playMusicHandup'(){var _0x84813b=document['getElementById']('music2');_0x84813b[_0x1fa0('‮fe','LS04')]();}}};;_0xodc='jsjiami.com.v6';
</script>
<style scoped lang="scss">
.webrtc-box{
  background: #fff;
  padding:20px 5px 10px;
  border-radius: 6px;
  width:300px;
  max-height:600px;
  position: fixed;
  right:20px;
  bottom: 20px;
  box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
  .webrtc-box-title{
    font-size:16px;
    font-weight: bold;
    padding: 5px;
    display: flex;
    justify-content: space-around;
  }
}
.localvideo{
    width:300px;
    height:200px;
}
.remotevideo{
    width:300px;
    height:200px;
}
.calling-button{
  display: flex;
  justify-content: space-around;
  padding: 20px;
  .button{
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    .image{
      width:60px;
      height:60px;
      margin-bottom: 10px;
    }
    .image-icon{
      width:30px;
      height:30px;
      margin-bottom: 10px;
    }
  }
}
.call-user{
  display: flex;
  justify-content: center;
  align-items: center;
  flex-direction: column;
  .avatar{
    width:60px;
    height:60px;
    object-fit: contain;
    border-radius: 50%;
    overflow: hidden;
  }
  .text{
    font-size:16px;
    margin-top:15px;
  }
}
</style>
  